function initUploadImageSize(id){
    var container = $('body');
    // var size=0;
    if (id){
        container = $(id);
    }
    // if(maxSize){
    //     size=maxSize;
    // }
    var uploadFiles = container.find('input[data-target="uploadImageFile"]');
    $.each(uploadFiles,function(i,v){
        $_self = $(v);
        var initialPreview = [];
        var initialPreviewConfig = [];
        var previewImage = $('input[name="'+$_self.attr('data-for')+'"]').attr('data-preview')||$('input[name="'+$_self.attr('data-for')+'"]').val();
        console.log(previewImage);
        if(previewImage){
            initialPreview.push(previewImage);
            initialPreviewConfig.push({key:getFileName(previewImage)})
        }
        $_self.fileinput({
            //allowedFileTypes:['image'],
            language:'zh',
            overwriteInitial:true,
            initialPreview:initialPreview,
            initialPreviewConfig:initialPreviewConfig,
            initialPreviewShowDelete: true,
            showUploadedThumbs: true,
            showCaption: true,
            deleteUrl:'',
            initialPreviewAsData: true,
            multiple:false,
            allowedFileExtensions:['jpg','jpeg','png','gif','ico','bmp'],
            uploadUrl: "/tmp/upload",
            maxFileSize:200,
            msgSizeTooLarge:'只能上传200kB大小的图像！',
            overwriteInitial:true,
            dropZoneEnabled:false,
            layoutTemplates: {
                actionDelete: ''
            }
        }).on('fileuploaded', function(event, data, previewId, index) {
            if (data.response.code == 0){
                if (typeof window.uploadFilesSuccess !== 'undefined'){
                    window.uploadFilesSuccess(data.response.result,$(event.target).attr('data-for'));
                }
                $('#'+previewId).attr('data-code',getFileName(data.response.result.attachment));
                $('input[name="'+$(event.target).attr('data-for')+'"]').val(data.response.result.original);
            }else {
                utils.showNotification('上传文件失败',3);
            }

        }).on('filecleared',function(event){
            //console.log(event,1);
            $('input[name="'+$(event.target).attr('data-for')+'"]').val('');
        }).on('filedeleted',function(event,key){
            //console.log(event,key,2);
            $('input[name="'+$(event.target).attr('data-for')+'"]').val('');
        }).on('filereset',function(event){
            // console.log(event,3);
            $('input[name="'+$(event.target).attr('data-for')+'"]').val('');
        }).on('filesuccessremove',function(event,id){
            $('input[name="'+$(event.target).attr('data-for')+'"]').val('');
        });
    })
};
